package org.pp.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 用户地址
 * </p>
 *
 * @author haima
 * @since 2024-10-20
 */
@Getter
@Setter
@TableName(value = "pp_user_address",autoResultMap = true)
@Schema(name = "PpUserAddress", description = "用户地址")
public class PpUserAddress implements Serializable {

    @Getter
    @Setter
    //区域信息对象
    public static  class Area{
        private String code;
        private String name;
    }

    private static final long serialVersionUID = 1L;

    @Schema(description = "地址id")
    @TableId(value = "address_id", type = IdType.AUTO)
    private Long addressId;

    @Schema(description = "用户id")
    private Long userId;

    @Schema(description = "完整地址")
    private String location;

    @Schema(description = "手机号")
    private String phone;

    @Schema(description = "地区 json array")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Area[] area;

    @Schema(description = "详细地址（不含地区)")
    private String detail;

    @Schema(description = "设置默认")
    private Boolean ifDefault;

    @Schema(description = "收件人姓名")
    private String name;

    @Schema(description = "租户号")
    private Long tenantId;

    @Schema(description = "乐观锁")
    private Integer revision;

    @Schema(description = "创建时间")
    private LocalDateTime createdTime;

    @Schema(description = "更新时间")
    private LocalDateTime updatedTime;

    @Schema(description = "逻辑删除 1为删除 0为正常")
    private Boolean deleted;
}
